package ipt.capitulo8;
import java.util.*;
public class CalculaFactorial{
	long calculaFactorial(long numero){
		long factorial=1;
		if( numero < 0)
			return -1;
		else if (numero==0) 
			return 1;
		for(long i=2; i<=numero; i++)
			factorial *=i;
		return factorial;
	}
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		System.out.print("\nIntroduce un numero: ");
		long num = sc.nextLong();
		CalculaFactorial x=new CalculaFactorial();
		System.out.printf("%d! =%d\n",
				num,x.calculaFactorial(num));
	}
}
